package Alibaba.AlibabaUtil;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class SHACoder {
	public static byte[] calcSHA256(byte[] fileBuffer, int length) {

		MessageDigest md = null;
		byte[] sha1hash = null;
		try {
			md = MessageDigest.getInstance("SHA-256");

		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
		md.update(fileBuffer, 0, length);
		sha1hash = md.digest();
		return sha1hash;

	}

}
